package com.tingyuge.thinking.spring.i18n;

import java.text.MessageFormat;
import java.util.Date;

/**
 * {@link java.text.MessageFormat}
 * @author xiaodao
 * @version 1.0
 * @date 2021/8/29
 */
public class MessageFormatDemo {

    public static void main(String[] args) {
        int planet = 7;
        String event = "a disturbance in the Force";

        String result = MessageFormat.format(
                "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
                planet, new Date(), event);
        System.out.println(result);
    }
}
